import request from '@/utils/request'
/**
 * 获取部门列表
 * @returns
 */
export const getDeptListAPI = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}
/**
 * 删除部门
 */
export const delDeptAPI = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
/**
 * 新增部门 传入一个参数对象deptForm
 */
export const addDeptAPI = (deptform) => {
  return request({
    method: 'post',
    url: '/company/department',
    data: deptform
  })
}
/**
 *获取部门负责人列表
 * @returns
 */
export const getManagerListAPI = () => {
  return request({
    method: 'get',
    url: '/sys/user/simple'
  })
}
/**
 * 根据id获取部门详情
 */
export const getDeptDetail = (deptId) => {
  return request({
    method: 'get',
    url: `/company/department/${deptId}`
  })
}
/**
 * 编辑部门
 */
export const editDeptDetail = (deptform) => {
  return request({
    method: 'put',
    url: `/company/department/${deptform.id}`,
    data: deptform
  })
}
